#ifndef CAMPAIGNITEM_H
#define CAMPAIGNITEM_H



#include "models_global.h"
#include "ItemGroup.h"
#include "ItemModel.h"



#include <QList>



//static const QString CAMPAIGN_NAME = QT_TRANSLATE_NOOP("CampaignItem","Campaign");



class MODELSSHARED_EXPORT CampaignItem : public ItemGroup
{
    Q_OBJECT

public:

    static CampaignItem* add(const QString& name = QString());
    static CampaignItem* take(const QString& name);

    static QList<CampaignItem*> campaigns();
    static CampaignItem* campaign(const QString& name);

    ItemModel* model() const;

    void setFilePath(const QString& file_path);
    QString filePath() const;

    void setDirty(const bool& dirty);
    bool isDirty() const;


protected slots:

    void onModelChanged();


protected:

    CampaignItem(const QString& name, QObject *parent = 0);

    static QList<CampaignItem*> c_campaigns;

    QPointer<ItemModel> m_model;
    QString m_filePath;
    bool m_dirty;


};

#endif // CAMPAIGNITEM_H
